﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ProductList.aspx.cs" Inherits="Admin_ProductList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>产品管理</title>
    <link href="AdminCSS/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">
        //弹出子窗体
        function openChildWindow() {
            window.open("AddProductInfo.aspx", "AddProduct", "height=800,wight=1000,top=270,left=500,toolbar=no,menubar=no,location=0,fullscreen=0,scrollbars=yes,resizable=no,location=no,status=no");
        }
        function modify(id) {
            window.open("AddProductInfo.aspx?id=" + id, "EditProduct", "height=400,wight=1000,top=270,left=500,toolbar=no,menubar=no,location=0,fullscreen=0,scrollbars=yes,resizable=no,location=no,status=no");
        }
        //编辑商品口味
        function EditWindow(id) {
            window.open("ModifyProductTaste.aspx?id=" + id, "EditWindow", "height=200,wight=500,top=270,left=500,toolbar=no,menubar=no,location=0,fullscreen=0,scrollbars=yes,resizable=no,location=no,status=no");
        }
        //编辑商品图片
        function EditImgWindow(id) {
            window.open("ModifyProductImg.aspx?id=" + id, "EditWindow", "height=400,wight=500,top=270,left=500,toolbar=no,menubar=no,location=0,fullscreen=0,scrollbars=yes,resizable=no,location=no,status=no");
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        商品Id：<asp:TextBox ID="txtProductId" runat="server" Width="50px"></asp:TextBox>
        名称：<asp:TextBox ID="txtProductName" runat="server" Width="100px"></asp:TextBox>
        规格：<asp:TextBox ID="txtProductStyle" runat="server" Width="100px"></asp:TextBox>
        价格：<asp:TextBox ID="txtProductPrice" runat="server" Width="100px"></asp:TextBox>
        分类：<asp:DropDownList ID="drpCategory" runat="server">
        </asp:DropDownList>
        状态：<asp:DropDownList ID="drpShelvesState" runat="server">
            <asp:ListItem Value="1">上架</asp:ListItem>
            <asp:ListItem Value="0">下架</asp:ListItem>
        </asp:DropDownList>
        &nbsp;<asp:Button ID="btnQuery" runat="server" OnClick="btnQuery_Click" Text="查询"
            Width="70px" />
        &nbsp; <a href="#" onclick="javascript:openChildWindow();">添加商品</a>
        <table border="0" cellpadding="0" cellspacing="1" width="100%" style="background: Black;">
            <tr style="height: 27px">
                <td style="background: #DFDEDC; width: 5%" align="center">
                    <strong>ID</strong>
                </td>
                <td style="background: #DFDEDC; width: 10%" align="center">
                    <strong>商品名</strong>
                </td>
                <td style="background: #DFDEDC; width: 10%" align="center">
                    <strong>商品英文名</strong>
                </td>
                <td style="background: #DFDEDC; width: 10%" align="center">
                    <strong>所属分类</strong>
                </td>
                <td style="background: #DFDEDC; width: 5%" align="center">
                    <strong>规格</strong>
                </td>
                <td style="background: #DFDEDC; width: 5%" align="center">
                    <strong>价格</strong>
                </td> 
                <td style="background: #DFDEDC; width: 5%" align="center">
                    <strong>排序号</strong>
                </td>
                <td style="background: #DFDEDC; width: 20%" align="center">
                    <strong>操作</strong>
                </td>
            </tr>
            <asp:Repeater runat="server" ID="rptProductList" OnItemCommand="rptProductList_ItemCommand"
                OnItemDataBound="rptProductList_ItemDataBound">
                <ItemTemplate>
                    <tr id="row" runat="server" style="background: White; height: 27px;">
                        <td align="center">
                            <%#Eval("Id") %>
                            <asp:HiddenField runat="server" ID="HIsShelves" Value='<%#Eval("IsShelves")%>' />
                        </td>
                        <td align="center">
                            <%#Eval("ProductName") %>
                        </td>
                        <td align="center">
                            <%#Eval("ProductEName")%>
                        </td>
                        <td align="center">
                            <%#Eval("CategoryId")%>
                        </td>
                        <td align="center">
                            <%#Eval("ProductStyle")%>
                        </td>
                        <td align="center">
                            <%#Eval("Price")%>
                        </td> 
                        <td align="center">
                            <%#Eval("OrderId")%>
                        </td>
                        <td align="center">
                            <a onclick="javascript:EditWindow('<%#Eval("Id")%>');" href="#">编辑口味</a> <a onclick="javascript:EditImgWindow('<%#Eval("Id")%>');"
                                href="#">编辑图片</a>
                            <input id="btnModify" type="button" value="修改" onclick="javascript:modify('<%#Eval("Id")%>')"
                                style="width: 50px" />
                            <asp:Button ID="btnUpShelves" CommandArgument='<%#Eval("Id")%>' CommandName="UpShelves"
                                runat="server" Text="上架" Width="50px" />
                            <asp:Button ID="btnDownShelves" CommandArgument='<%#Eval("Id")%>' CommandName="DownShelves"
                                runat="server" Text="下架" Width="50px" />
                            <asp:Button ID="btnDel" CommandArgument='<%#Eval("Id")%>' CommandName="Del" runat="server"
                                Text="删除" OnClientClick="return confirm('确认');" Width="50px" />
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </table>
    </div>
    </form>
</body>
</html>
